<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="renderer" content="webkit">
    <link rel="stylesheet" type="text/css"
          href="<?php xcho(loadSource('/assets/plugins/bootstrap/css/bootstrap.min.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/animate.css/animate.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/font-awesome/css/font-awesome.css')) ?>">
    <link rel="stylesheet"
          href="<?php xcho(loadSource('/assets/plugins/data-table/media/css/dataTables.bootstrap.min.css')) ?>">
<!--    <link rel="stylesheet" href="--><?php //xcho(loadSource('/assets/plugins/ztree/css/zTreeStyle/zTreeStyle.css')) ?><!--">-->
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/layui/css/layui.css')) ?>" media="all">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/ztree/css/zTreeStyle/zTreeStyle.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/ztree/css/metroStyle/metroStyle.css')) ?>" type="text/css">
    <link rel="stylesheet" href="<?php xcho(loadSource('/app/css/style.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/app/css/app.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/css/new_main.css')) ?>">
</head>
<body><?php include_once TPL_PATH . 'public/nav.phtml'; ?>
    <div class="class-box">
        <div class="class-box-head ">
            <div class="class-box-title">
                <h3 class="col-md-11">
                    短信模板
                </h3>
                <div class="col-md-1">
                    <a href="<?php xcho(url('/sysmanager/sms/index')) ?>">返回列表</a>
                </div>
            </div>
        </div>
        <div class="class-box-body">
            <div class="form-horizontal">
                
                 <div class="form-group">
                    <label class="col-sm-1 control-label" for="">主题</label>
                    <div class="col-sm-11">
                        <textarea name="title" rows="3" class="form-control" placeholder="请输入主题"></textarea>
                    </div>
                </div>

                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="">内容</label>
                    <div class="col-sm-11">
                        <textarea name="message" rows="6" class="form-control"  placeholder="请输入内容"></textarea>
                    </div>
                </div>

            </div>

            <div class="btns-group">
                <button name="btn" class="btn_mould">确定</button>
            </div>

        </div>
    </div>
<input type="hidden" name="addMould"  value="<?php xcho($addMould) ?>" />
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"></script>
<script>

    $(document).ready(function(){
        $(".btn_mould").click(function(){
            var title=$("textarea[name='title']").val();
            var message=$("textarea[name='message']").val();
            if(title==''||title==null){
                alert('主题不能为空');
                return false;
            }
            if(message==''||message==null){
                alert('内容不能为空');
                return false;
            }
            var url=$("input[name='addMould']").val();
            $.ajax({
                url:url,
                type:'POST',
                dataType:'json',
                data:{title:title,message:message},
                success:function (resp) {
                     if(resp.success == 1){
                         alert('添加成功');
                         location.href = "/sysmanager/sms/index";
                     }else {
                         alert('添加失败');
                         location.href = "/sysmanager/sms/index";
                     }
                }
            })
        });
    });

</script>
    <?php include_once TPL_PATH . 'public/foot_script.phtml'; ?>
<button id="top" style="height: 50px;width: 50px;"></button></body>
</html>